package hu.bluerainbow.gifter.provider.impl;

import hu.bluerainbow.gifter.bean.Gift;
import hu.bluerainbow.gifter.provider.GiftDataProvider;

abstract class AbstractGiftDataProvider implements GiftDataProvider {

	private Gift gift;
	
	public AbstractGiftDataProvider(Gift gift) {
		this.gift = gift;
	}
	
	@Override
	public String getImageURL() {
		String imageDir = null;
		String headerSize = null;
		if (gift.isBundle()) {
			imageDir = "subs";
			headerSize = "586x192";
		} else {
			imageDir = "apps";
			headerSize = "292x136";
		}
		
//		return "http://cdn.steampowered.com/v/gfx/" + imageDir + "/" + gift.getSteamCode() + "/header_" + headerSize + ".jpg";
		return "http://cdn.akamai.steamstatic.com/steam/" + imageDir + "/" + gift.getSteamCode() + "/header_" + headerSize + ".jpg";
	}
	
	protected Gift getGift() {
		return gift;
	}
	
}
